<?php 
include TMPL_PATH.'public/header.phtml';
?>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='javascript:;' class="on"><em>管理员管理</em></a><span>|</span><a href='javascript:add();' ><em>添加管理员</em></a>    </div>
</div>
<div class="pad_10">
<div class="table-list">
    <table width="100%" cellspacing="0">
      <thead>
				<tr>
				<th width="10%">序号</th>
				<th width="10%" align="left" >用户名</th>
				<th width="10%" align="left" >所属角色</th>
				<th width="10%"  align="left" >最后登录IP</th>
				<th width="15%"  align="left" >最后登录时间</th>
				<th width="15%"  align="left" >E-mail</th>
				<th width="10%">真实姓名</th>
				<th width="10%">状态</th>
				<th width="10%" >管理操作</th>
				</tr>
      </thead>
     <tbody>
        <?php foreach ($adminList as $v):?>
			<tr>
				<td width="10%" align="center"><?php echo $v['id']?></td>
				<td width="10%" ><?php echo $v['username']?></td>
				<td width="10%" ><?php echo $v['rolename']?></td>
				<td width="10%" ><?php echo $v['lastloginip']?></td>
				<td width="15%"  ><?php echo date('Y-m-d H:i:s', $v['lastlogintime'])?></td>
				<td width="15%"><?php echo $v['email']?></td>
				<td width="10%"  align="center"><?php echo $v['realname']?></td>
				<td width="10%"  align="center"><?php if($v['display']==1){?><font color="red">√</font><?php }else{?><font color="blue">×</font><?php }?></td>
				<td width="10%"  align="center">
				<a href="javascript:edit(<?php echo $v['id']?>, '<?php echo $v['username']?>')">修改</a> | 
				<?php if($v['id'] == 1 || $v['id']==$_SESSION['admin_user_info']['id']){?>
				<font color="#cccccc">删除</font>
				<?php }else{?>
				<a href="javascript:confirmurl('<?php echo U('manage/delete','userid='.$v['id'])?>', '是否删除该管理员?')">删除</a>
				<?php }?>
				</td>
			</tr>
			<?php endforeach;?>
		</tbody>
	</table>
</div>
</div>
</body>
</html>
<script type="text/javascript">
<!--
	function edit(id, name) {
		window.top.art.dialog({title:'修改--'+name, id:'edit', iframe:'<?php echo U('manage/edit');?>&userid='+id ,width:'500px',height:'400px'}, 	function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;
		var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
	}
function add() {
	window.top.art.dialog({title:'添加--管理员', id:'add', iframe:'<?php echo U('manage/add');?>' ,width:'500px',height:'400px'}, 	function(){var d = window.top.art.dialog({id:'add'}).data.iframe;
	var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'add'}).close()});
}
//-->
</script>